<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1.获取URL连接中的参数
        var paramStr = window.location.search;//?userName=aaaa
        console.log('未处理的参数字符串===' + paramStr);
        var paramArray = paramStr.substr(1).split('=');
        var value = paramArray[paramArray.length-1];
        console.log(value);
    </script>
</body>
</html>